package licode.unisop.platform.client.feign;

import licode.unisop.platform.client.info.PlatSaveAssetIn;
import licode.unisop.platform.client.info.PlatformSaveIn;
import licode.unisop.provider.info.SiPlatformId;
import licode.unisop.unilite.result.UniResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 平台操作远程实现
 *
 * @author licode
 */
@FeignClient(name = "${uni-sop.platform.service:uni-platform-service}", url = "${uni-sop.platform.host:}")
public interface PlatformApiFeign {
    /**
     * 保持平台信息
     * @param platform 平台信息
     */
    @PostMapping("/plat-api/v1/internal/platform/add")
    UniResult<String> addPlatform(@RequestBody PlatformSaveIn platform);

    @PostMapping("/plat-api/v1/internal/platform/update")
    UniResult<String> updatePlatform(@RequestBody PlatformSaveIn platform);

    /**
     * 根据操作类型完成对资源的处理
     * @param opInfo 资源
     */
    @PostMapping("/plat-api/v1/internal/platform/asset/save")
    UniResult<String> saveAsset(@RequestBody PlatSaveAssetIn opInfo);
}